package com.gc.server.vo.down;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class ApplyGoodsItemDown {

    @ExcelProperty("产品名")
    private String name;

    @ExcelProperty("单价")
    private BigDecimal price;

    @ExcelProperty("总数")
    private Integer totalQuantity;

    @ExcelProperty("总金额")
    private BigDecimal totalPrice;

    public ApplyGoodsItemDown(String name, BigDecimal price, Integer totalQuantity, BigDecimal totalPrice) {
        this.name = name;
        this.price = price;
        this.totalQuantity = totalQuantity;
        this.totalPrice = totalPrice;
    }

    public void addQuantity(Integer quantity){
        this.totalQuantity += quantity;
    }

    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(this.totalQuantity));
    }
}
